package com.bifang.module.file.dao.model;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 文件元数据
 *
 * @author chenzh
 * @since 2021-01-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("FILE_METADATA")
@Schema(title ="FileMetadata对象", description = "文件元数据")
// @KeySequence(value = "SQ_FILE_METADATA_ID", clazz = Long.class)
public class FileMetadata extends Model<FileMetadata> {

    private static final long serialVersionUID = 1L;

    @Schema(title = "文件元数据id")
    @TableId(value = "FILE_METADATA_ID", type = IdType.ASSIGN_ID)
    private BigDecimal fileMetadataId;

    @Schema(title = "文件id")
    @TableField("FILE_ID")
    private BigDecimal fileId;

    @Schema(title = "文件附加字段id")
    @TableField("FILE_FIELD_ID")
    private BigDecimal fileFieldId;

    @Schema(title = "字段类型")
    @TableField("FIELD_TYPE")
    private String fieldType;

    @Schema(title = "字段标识")
    @TableField("FIELD_KEY")
    private String fieldKey;

    @Schema(title = "字段中文")
    @TableField("FIELD_NAME")
    private String fieldName;

    @Schema(title = "文件元数据值")
    @TableField("FIELD_VALUE")
    private String fieldValue;

    @Schema(title = "文件元数据字典值")
    @TableField("FIELD_TEXT")
    private String fieldText;
    @Schema(title = "保存的表名")
    private String tableName;
    @Override
    public Serializable pkVal() {
        return this.fileMetadataId;
    }
}
